query($sql); if ($result) { while($row = $result->fetch_assoc()){ $return[] = $row; } } if (is_numeric($return_position)) return @$return[$return_position]; else return $return; } $cdn="https://e0c4603e0ae9e2d55527-0cc62ff2f0a9fe74c192530ba735e808.ssl.cf2.rackcdn.com"; //require_once($_SERVER['DOCUMENT_ROOT'].'/assets/plugins/facebook/facebook.php'); //$facebook_api = new Facebook(array("appId" => '464039380296913',"secret" => '68ba2a0837e144d8b0a80a04754d7fd8')); 0) { $nestedq="select * from pages where hide_page<>1 and deleted<>1 and id=".$nested_page['parent']; $nestedr=$main_db->query($nestedq); if ($nested_page=$nestedr->fetch_assoc()) { $parent_id=$nested_page['parent']; $nested_url="/".$nested_page['slug'].$nested_url; } } $nested_url=$nested_url."/"; return "href='".$nested_url."'"; } } function clean($string) { $string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens. $string = preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars. $string=strtolower($string); return preg_replace('/-+/', '-', $string); // Replaces multiple hyphens with single one. } function output_mobile_nav($page, $level=1) { global $main_db; $subnavq = "SELECT * from pages where hide_page<>1 and deleted<>1 and parent=".$page['id']." order by sort"; //echo "select * from pages where hide_page<>1 and deleted<>1 and parent=".$page['id']." order by sort"; $subnavr = db_query($subnavq); //$subnav_count=$subnavr->num_rows; $url=array(); $liclass=''; $icon=""; $uri=explode("/",$_SERVER['REQUEST_URI']); $uricount=count($uri)-2; if (empty($subnavr)) { //echo $uri[$uricount]; echo "
  • ".$page['nav_title']."
  • ".PHP_EOL; } else { $subnavclass=""; if ($level==1) { $liclass='class="menu-item-has-children"'; } echo "
  • ".$page['nav_title']."".PHP_EOL; if ($level==1) { echo ""; } echo "
  • ".PHP_EOL; } } // create functions for cleaning content below, makes it easier to tweak the structure and add filters, etc // we were also repeating ourself for the custom widgets and that was just silly. function output_content($type, $content, $location) { global $cdn; global $main_db; global $recaptcha_site_key; global $recaptcha_secret; global $page; $enddiv=0; if ($location=='sidebar') { echo '
    '; $enddiv=1; } if ($type=='image') { $image = json_decode($content, true); if ($location=='sidebar') { echo ''.$image['alt'].''; if (strlen($image['caption'])>0) { echo "
    ".$image['caption'].""; } } else { echo '
    '.$image['alt'].''; if (strlen($image['caption'])>0) { echo '
    '.$image['caption'].'
    '; } echo '
    '; } } elseif ($type=='text') { echo '
    '; echo str_replace("
    '; } elseif ($type=='widget') { include($_SERVER['DOCUMENT_ROOT'] .'/assets/widgets/'.$content); } if ($enddiv==1) { echo '
    '; } } function getParent($pid) { $parentq = db_query("SELECT * from pages where id=".$pid, 0); if (!empty($parentq)) { if ($parentq['parent'] > 0) { return getParent($parentq['parent']); } else { return $pid; } } else { return $pid; } } function constructURL($texttochange) { $texttochange = str_replace(' ', '-', $texttochange); // Replaces all spaces with hyphens. $texttochange = str_replace('/', '-', $texttochange); // Replaces all / with -. $texttochange = str_replace('&', 'and', $texttochange); // Replaces & with and. return preg_replace('/[^A-Za-z0-9\-]/', '', $texttochange); // Removes special chars. } function find_hyperlinks($s) { return preg_replace('@(https?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?)?)@', '$1', $s); } /* function twitter_username_link($s) { return preg_replace("/@(\w+)/", "@\\1", $s); } function twitter_hashtag_link($s) { return preg_replace('/#([\\d\\w]+)/', '$0', $s); } function twitter_feed($limit) { $twitter_query = mysql_query("SELECT * FROM social_feeds WHERE type = 'twitter'"); $twitter = mysql_fetch_assoc($twitter_query); $tweets = unserialize($twitter['feed']); $output = ''; foreach ($tweets as $tweet) { $limiter++; $url = 'https://twitter.com/ContBldgSystems/status/'.$tweet->id; $output .= '

    '.date('M j', strtotime($tweet->created_at)).': '.twitter_hashtag_link(twitter_username_link(find_hyperlinks($tweet->text))).'

    '; if ($limiter == $limit) { break; } } return $output; } function facebook_hashtag_link($s) { return preg_replace('/#([\\d\\w]+)/', '$0', $s); } */ ?> subject(stripslashes($subject)); // message $email->messageHtml(stripslashes($message)); // to $to = explode(",", $to); foreach ($to as $e) $email->addTo(trim($e)); // reply to if ($replyto) $email->replyTo($replyto); // send $mail = $email->send(); } ?>
    Warning: Undefined variable $main_db in /home/ifprepeoudn2/public_html/rriavascularir.com/content/assets/page-templates/pages.php on line 10

    Fatal error: Uncaught TypeError: mysqli_real_escape_string(): Argument #1 ($mysql) must be of type mysqli, null given in /home/ifprepeoudn2/public_html/rriavascularir.com/content/assets/page-templates/pages.php:10 Stack trace: #0 /home/ifprepeoudn2/public_html/rriavascularir.com/content/assets/page-templates/pages.php(10): mysqli_real_escape_string() #1 {main} thrown in /home/ifprepeoudn2/public_html/rriavascularir.com/content/assets/page-templates/pages.php on line 10